﻿@{
    ViewBag.Title = "Edit_Menu";
    Layout = "~/Views/Shared/_LayoutChild.cshtml";
}
@model Agro.Models.T_Action
@section head
{
    <script language="javascript" type="text/javascript">
        var _type ='@ViewBag.type';
        $(document).ready(function () {
            if (_type != null && _type == "edit")
                $("#ActionCode").attr("disabled", "disabled");
        });

        function Save(t) {//t是弹出窗口的对象 ，主要用来关门该弹出窗口
            //菜单名称
            var menuName = $("#ActionCode").val();
            if (menuName == "") {
                alert("功能编号不能为空!");
                return;
            }
            //Url地址
            var menuUrl = $("#ActionName").val();
            if (menuUrl == "") {
                alert("功能名称不能为空!");
                return;
            }

            $.funSaveForm("/ActionManager/Action/Action_Save", "formDetail", function (d) {
                if (d == undefined || d == "") {
                    parent.asyncbox.tips('保存失败!', 'error');
                    return;
                }
                else {
                    $("#ActionID").val(d);
                    parent.asyncbox.tips('保存成功!', 'success');
                    MainFrame().refreshTreeNode(_type);
                    MainFrame().$(MainFrame().gridId).trigger("reloadGrid");
                    parent.$.close(t.id);
                    return;

                }
            });
        }
    </script>
}
<!--主窗体，页面都需要的div-->
<div class="ui-layout-center" style="overflow: hidden;">
    @using (Html.BeginForm("", "", FormMethod.Post, new Dictionary<string, object> { { "id", "formDetail" } }))
    {
        @Html.HiddenFor(model => model.MenuID) 
        @Html.HiddenFor(model => model.ActionID)
        <div class='b-col'>
            <div class="col-name">
                <font color="red">*</font><font color="blue"> 功能编号：</font></div>
            <div class="col-input">@Html.TextBoxFor(model => model.ActionCode)</div>
        </div>
        <div class='b-col'>
            <div class="col-name">
                <font color="red">*</font><font color="blue">功能名称：</font></div>
            <div class="col-input">@Html.TextBoxFor(model => model.ActionName)</div>
        </div>
        <div class='b-col'>
            <div class="col-name">
                <font color="blue">功能描述：</font></div>
            <div class="col-input">@Html.TextBoxFor(model => model.ActionRemark)</div>
        </div>
        
    }
</div>
